//
//  AppDelegate.m
//  JoinSdkDemo
//
//  Created by mac on 2021/4/8.
//

#import "AppDelegate.h"

#import "AppDelegate.h"
#import "JoinSdkDemo-Bridging-Header.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

// UIApplicationDelegate todo ------

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    NSLog(@"channel=%@ appId=%@", [JoinSdk getChannel], [JoinSdk getAppId]);
    return [JoinSdk application:application didFinishLaunchingWithOptions:launchOptions];
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    return [JoinSdk application:app open:url options:options];
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
    return [JoinSdk application:application continue:userActivity restorationHandler:restorationHandler];
}

- (void)applicationWillResignActive:(UIApplication *)application {
    [JoinSdk applicationWillResignActive:application];
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    [JoinSdk applicationDidEnterBackground:application];
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    [JoinSdk applicationWillEnterForeground:application];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    [JoinSdk applicationDidBecomeActive:application];
}

- (void)applicationWillTerminate:(UIApplication *)application {
    [JoinSdk applicationWillTerminate:application];
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    [JoinSdk application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
    [JoinSdk application:application didFailToRegisterForRemoteNotificationsWithError:error];
}

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
    return [JoinSdk application:application supportedInterfaceOrientationsFor:window];
}

// UIApplicationDelegate todo ------


#pragma mark - UISceneSession lifecycle


- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
    // Called when a new scene session is being created.
    // Use this method to select a configuration to create the new scene with.
    return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}


- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
    // Called when the user discards a scene session.
    // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
    // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}


@end
